package ziface

import (
	"net"
)

type IConnection interface {
	//启动连接，让当前连接开始工作
	Start()

	//停止
	Stop()

	//获取原始socket
	GetTCPConnection() *net.TCPConn

	//连接id
	GetConnID() uint32

	//远程地址
	RemoteAddr() net.Addr

	//直接将message数据发送给远程的tcp客户端
	SendMsg(msgId uint32, data []byte) error
	//带缓存
	SendBuffMsg(msgId uint32, data []byte) error

	//设置链接属性
	SetProperty(key string, value interface{})
	//获取链接属性
	GetProperty(key string) (interface{}, error)
	//移除链接属性
	RemoveProperty(key string)
}
